package com.itheima04;

import java.util.*;
import java.util.stream.Stream;

public class Test01 {
    public static void main(String[] args) {
//        ArrayList<String> s1=new ArrayList<>();
//        s1.add("11");
//        s1.add("22");
//        s1.add("33");
        List<String> s1 = List.of("11", "22", "33");
        s1.stream().forEach(s -> System.out.println(s));
        System.out.println("-----------------------");
//        Map<Integer,Integer> s2=new HashMap<>();
//        s2.put(44,55);
//        s2.put(66,77);
//        s2.put(88,99);
        Map<Integer, Integer> s2 = Map.of(44, 55, 66, 77, 88, 99);
        s2.keySet().stream().forEach(s -> System.out.println(s));
        System.out.println("-----------------------");
        s2.entrySet().stream().forEach(s -> System.out.println(s.getKey()));
        System.out.println("-----------------------");
        s2.entrySet().stream().forEach(s -> System.out.println(s.getValue()));
        System.out.println("-----------------------");

        int[] s3 = {11, 22, 33};
        Arrays.stream(s3).forEach(s -> System.out.println(s));
        System.out.println("-----------------------");
        Stream.of(44, 55, 66).forEach(s -> System.out.println(s));
        System.out.println("-----------------------");
        List<String> list = List.of("11", "22", "33", "44");
        list.forEach(s -> System.out.println(s));
    }
}
